<template>
    <div id="root">
        <h2>这是child2</h2>
        <input type="text">
    </div>
</template>

<script>
    export default {
        name: "Child2",
        created() {
            console.log("这是child2组件的创建")
        },
        beforeDestroy() {
            console.log("这child2组件的即将被销毁")
        }
    }
</script>

<style scoped>
#root{
    background-color: olivedrab;
    height: 200px;
}
</style>